3.91 \(\int \frac {A+B x+C x^2+D x^3}{x (a+b x^2)} \, dx\)

Optimal. Leaf size=72 \[ -\frac {(A b-a C) \log \left (a+b x^2\right )}{2 a b}+\frac {A \log (x)}{a}+\frac {(b B-a D) \tan ^{-1}\left (\frac {\sqrt {b} x}{\sqrt {a}}\right )}{\sqrt {a} b^{3/2}}+\frac {D x}{b} \]

[Out]

D*x/b+A*ln(x)/a-1/2*(A*b-C*a)*ln(b*x^2+a)/a/b+(B*b-D*a)*arctan(x*b^(1/2)/a^(1/2))/b^(3/2)/a^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.10, antiderivative size = 72, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {1802, 635, 205, 260} \[ -\frac {(A b-a C) \log \left (a+b x^2\right )}{2 a b}+\frac {A \log (x)}{a}+\frac {(b B-a D) \tan ^{-1}\left (\frac {\sqrt {b} x}{\sqrt {a}}\right )}{\sqrt {a} b^{3/2}}+\frac {D x}{b} \]

Antiderivative was successfully verified.

[In]

Int[(A + B*x + C*x^2 + D*x^3)/(x*(a + b*x^2)),x]

[Out]

(D*x)/b + ((b*B - a*D)*ArcTan[(Sqrt[b]*x)/Sqrt[a]])/(Sqrt[a]*b^(3/2)) + (A*Log[x])/a - ((A*b - a*C)*Log[a + b*
x^2])/(2*a*b)

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 260

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rule 635

Int[((d_) + (e_.)*(x_))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Dist[d, Int[1/(a + c*x^2), x], x] + Dist[e, Int[x/
(a + c*x^2), x], x] /; FreeQ[{a, c, d, e}, x] &&  !NiceSqrtQ[-(a*c)]

Rule 1802

Int[(Pq_)*((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*Pq*(a + b*x
^2)^p, x], x] /; FreeQ[{a, b, c, m}, x] && PolyQ[Pq, x] && IGtQ[p, -2]

Rubi steps

\begin {align*} \int \frac {A+B x+C x^2+D x^3}{x \left (a+b x^2\right )} \, dx &=\int \left (\frac {D}{b}+\frac {A}{a x}+\frac {a (b B-a D)-b (A b-a C) x}{a b \left (a+b x^2\right )}\right ) \, dx\\ &=\frac {D x}{b}+\frac {A \log (x)}{a}+\frac {\int \frac {a (b B-a D)-b (A b-a C) x}{a+b x^2} \, dx}{a b}\\ &=\frac {D x}{b}+\frac {A \log (x)}{a}-\frac {(A b-a C) \int \frac {x}{a+b x^2} \, dx}{a}+\frac {(b B-a D) \int \frac {1}{a+b x^2} \, dx}{b}\\ &=\frac {D x}{b}+\frac {(b B-a D) \tan ^{-1}\left (\frac {\sqrt {b} x}{\sqrt {a}}\right )}{\sqrt {a} b^{3/2}}+\frac {A \log (x)}{a}-\frac {(A b-a C) \log \left (a+b x^2\right )}{2 a b}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.06, size = 73, normalized size = 1.01 \[ \frac {(a C-A b) \log \left (a+b x^2\right )}{2 a b}+\frac {A \log (x)}{a}-\frac {(a D-b B) \tan ^{-1}\left (\frac {\sqrt {b} x}{\sqrt {a}}\right )}{\sqrt {a} b^{3/2}}+\frac {D x}{b} \]

Antiderivative was successfully verified.

[In]

Integrate[(A + B*x + C*x^2 + D*x^3)/(x*(a + b*x^2)),x]

[Out]

(D*x)/b - ((-(b*B) + a*D)*ArcTan[(Sqrt[b]*x)/Sqrt[a]])/(Sqrt[a]*b^(3/2)) + (A*Log[x])/a + ((-(A*b) + a*C)*Log[
a + b*x^2])/(2*a*b)

________________________________________________________________________________________

fricas [A]  time = 0.68, size = 158, normalized size = 2.19 \[ \left [\frac {2 \, D a b x + 2 \, A b^{2} \log \relax (x) - {\left (D a - B b\right )} \sqrt {-a b} \log \left (\frac {b x^{2} + 2 \, \sqrt {-a b} x - a}{b x^{2} + a}\right ) + {\left (C a b - A b^{2}\right )} \log \left (b x^{2} + a\right )}{2 \, a b^{2}}, \frac {2 \, D a b x + 2 \, A b^{2} \log \relax (x) - 2 \, {\left (D a - B b\right )} \sqrt {a b} \arctan \left (\frac {\sqrt {a b} x}{a}\right ) + {\left (C a b - A b^{2}\right )} \log \left (b x^{2} + a\right )}{2 \, a b^{2}}\right ] \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((D*x^3+C*x^2+B*x+A)/x/(b*x^2+a),x, algorithm="fricas")

[Out]

[1/2*(2*D*a*b*x + 2*A*b^2*log(x) - (D*a - B*b)*sqrt(-a*b)*log((b*x^2 + 2*sqrt(-a*b)*x - a)/(b*x^2 + a)) + (C*a
*b - A*b^2)*log(b*x^2 + a))/(a*b^2), 1/2*(2*D*a*b*x + 2*A*b^2*log(x) - 2*(D*a - B*b)*sqrt(a*b)*arctan(sqrt(a*b
)*x/a) + (C*a*b - A*b^2)*log(b*x^2 + a))/(a*b^2)]

________________________________________________________________________________________

giac [A]  time = 0.45, size = 66, normalized size = 0.92 \[ \frac {D x}{b} + \frac {A \log \left ({\left | x \right |}\right )}{a} - \frac {{\left (D a - B b\right )} \arctan \left (\frac {b x}{\sqrt {a b}}\right )}{\sqrt {a b} b} + \frac {{\left (C a - A b\right )} \log \left (b x^{2} + a\right )}{2 \, a b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((D*x^3+C*x^2+B*x+A)/x/(b*x^2+a),x, algorithm="giac")

[Out]

D*x/b + A*log(abs(x))/a - (D*a - B*b)*arctan(b*x/sqrt(a*b))/(sqrt(a*b)*b) + 1/2*(C*a - A*b)*log(b*x^2 + a)/(a*
b)

________________________________________________________________________________________

maple [A]  time = 0.01, size = 80, normalized size = 1.11 \[ \frac {B \arctan \left (\frac {b x}{\sqrt {a b}}\right )}{\sqrt {a b}}-\frac {D a \arctan \left (\frac {b x}{\sqrt {a b}}\right )}{\sqrt {a b}\, b}+\frac {A \ln \relax (x )}{a}-\frac {A \ln \left (b \,x^{2}+a \right )}{2 a}+\frac {C \ln \left (b \,x^{2}+a \right )}{2 b}+\frac {D x}{b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((D*x^3+C*x^2+B*x+A)/x/(b*x^2+a),x)

[Out]

D*x/b-1/2*A/a*ln(b*x^2+a)+1/2/b*ln(b*x^2+a)*C+1/(a*b)^(1/2)*arctan(1/(a*b)^(1/2)*b*x)*B-a/b/(a*b)^(1/2)*arctan
(1/(a*b)^(1/2)*b*x)*D+A/a*ln(x)

________________________________________________________________________________________

maxima [A]  time = 2.93, size = 65, normalized size = 0.90 \[ \frac {D x}{b} + \frac {A \log \relax (x)}{a} - \frac {{\left (D a - B b\right )} \arctan \left (\frac {b x}{\sqrt {a b}}\right )}{\sqrt {a b} b} + \frac {{\left (C a - A b\right )} \log \left (b x^{2} + a\right )}{2 \, a b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((D*x^3+C*x^2+B*x+A)/x/(b*x^2+a),x, algorithm="maxima")

[Out]

D*x/b + A*log(x)/a - (D*a - B*b)*arctan(b*x/sqrt(a*b))/(sqrt(a*b)*b) + 1/2*(C*a - A*b)*log(b*x^2 + a)/(a*b)

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.01 \[ \int \frac {A+B\,x+C\,x^2+x^3\,D}{x\,\left (b\,x^2+a\right )} \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A + B*x + C*x^2 + x^3*D)/(x*(a + b*x^2)),x)

[Out]

int((A + B*x + C*x^2 + x^3*D)/(x*(a + b*x^2)), x)

________________________________________________________________________________________

sympy [F(-1)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((D*x**3+C*x**2+B*x+A)/x/(b*x**2+a),x)

[Out]

Timed out

________________________________________________________________________________________